package io.israel.ephraim;

import lombok.extern.slf4j.Slf4j;
import org.flowable.engine.delegate.DelegateExecution;
import org.flowable.engine.delegate.JavaDelegate;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @author imlij
 */
@Slf4j
@Component
public class BpmnErrorLoggingDelegate implements JavaDelegate {
	@Override
	public void execute(DelegateExecution execution) {
		String processInstanceId = execution.getProcessInstanceId();
		Map<String, Object> variables = execution.getVariables();
		log.error("Error {} {}", processInstanceId, variables);
	}
}
